home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / language / gemfsc18.lzh / AESSRC18.LZH / AESFUNCS / OBJXTUTL.C < prev    next >
C/C++ Source or Header  |  1992-03-07  |  892b  |  28 lines

  1. /**************************************************************************
  2.  * OBJXTUTL.C - Functions for dealing with extended object types.
  3.  *************************************************************************/
  4.  
  5. #include "gemfast.h"
  6.  
  7. /*-------------------------------------------------------------------------
  8.  * obj_xtfind - Return index of object with specified extended object type.
  9.  *-----------------------------------------------------------------------*/
  10.  
  11. int obj_xtfind(ptree, parent, xtype)
  12.     register OBJECT *ptree;
  13.     register int    parent; 
  14.     register char   xtype;
  15. {
  16.     register int    curobj;
  17.  
  18.     curobj = ptree[parent].ob_head;
  19.     while(curobj != parent && curobj != -1) {
  20.         if (xtype == *(char *)&(ptree[curobj].ob_type)) { 
  21.             return curobj;
  22.         }
  23.         curobj = ptree[curobj].ob_next; 
  24.     }
  25.     return -1;
  26. }
  27.  
  28.